import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Nyt7ClaimVO, Nyt7ClaimForm, Nyt7ClaimQuery } from '@/api/Nyt7Claim/Nyt7Claim/types';

/**
 * 查询保险理赔列表
 * @param query
 * @returns {*}
 */

export const listNyt7Claim = (query?: Nyt7ClaimQuery): AxiosPromise<Nyt7ClaimVO[]> => {
  return request({
    url: '/Nyt7Claim/Nyt7Claim/list',
    method: 'get',
    params: query
  });
};


export const Nyt7ClaimChart = (query?: Nyt7ClaimQuery): AxiosPromise<Nyt7ClaimVO[]> => {
  return request({
    url: '/Nyt7Claim/Nyt7ClaimChart/chart',
    method: 'get',
    params: query
  });
};

/**
 * 查询保险理赔详细
 * @param id
 */
export const getNyt7Claim = (id: string | number): AxiosPromise<Nyt7ClaimVO> => {
  return request({
    url: '/Nyt7Claim/Nyt7Claim/' + id,
    method: 'get'
  });
};

/**
 * 新增保险理赔
 * @param data
 */
export const addNyt7Claim = (data: Nyt7ClaimForm) => {
  return request({
    url: '/Nyt7Claim/Nyt7Claim',
    method: 'post',
    data: data
  });
};

/**
 * 修改保险理赔
 * @param data
 */
export const updateNyt7Claim = (data: Nyt7ClaimForm) => {
  return request({
    url: '/Nyt7Claim/Nyt7Claim',
    method: 'put',
    data: data
  });
};

/**
 * 删除保险理赔
 * @param id
 */
export const delNyt7Claim = (id: string | number | Array<string | number>) => {
  return request({
    url: '/Nyt7Claim/Nyt7Claim/' + id,
    method: 'delete'
  });
};
